import themidibus.*;



class ClientMidi
{
  
  MidiBus myBus;
  

  ClientMidi(PApplet mom)
  {
      println("Start Client MIDI");
      MidiBus.list();
      myBus = new MidiBus(mom, -1, "p551");
  }
  
  void send()
  {
    int channel = int(random(2));
    
    
    int[] notes = {0, 2, 4, 5, 7, 9, 11};
    
    int octava = 4;//int(random(3,9));
    
    int noteslength = notes.length;
    int rnd = int(random(noteslength));
    int note = notes[ rnd ] + 12*octava;

    
    int pitch = int(random(127));
    int velocity = 127;

    myBus.sendNoteOff(channel, note, velocity);
    myBus.sendNoteOn(channel, note, velocity);
  }
  
  
  
  
  
}
